#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>


int main(int argc,char *argv[])
{
	char buffer[100]={""};
	int fd = open("/dev/firstdev", O_RDWR);
	if(fd < 0)
	{
		printf("open [%s] failed\n", "/dev/firstdev");
		return -1;
	}

	read(fd , buffer, 10);
	char *s = "hello, world";
	write(fd, s, strlen(s));
	close(fd);
	return 0;
}
